package threadStudy;

public class SleepTest {
    public static void main(String[] args) {
        SleepStudy sleepStudy = new SleepStudy();
        System.out.println("主线程开始时间="+System.currentTimeMillis());
        sleepStudy.start();
        System.out.println("主线程结束时间="+System.currentTimeMillis());
    }
}
class SleepStudy extends Thread {
    @Override
    public void run() {
        System.out.println("正在运行" + this.currentThread().getName());
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println("正在运行" + this.currentThread().getName());
    }
}